package com.wzy.pachong;

import java.util.LinkedList;
import java.util.Properties;

public class Config {

	private String[] host;

	public static final String ua = "User-Agent:Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 MobileSafari/537.36";

	public LinkedList<Page> urlList = new LinkedList<Page>();

	private String targetRule = "div#MyContent a img";

	private String[] helpRule;

	private Prop prop;
	
	private String localPath;

	public String[] getHost() {
		return this.host;
	}

	public void setHost(String[] hOST) {
		this.host = hOST;
	}

	public LinkedList<Page> getUrlList() {
		return urlList;
	}

	public void setUrlList(LinkedList<Page> urlList) {
		this.urlList = urlList;
	}

	public String getTargetRule() {
		return targetRule;
	}

	public void setTargetRule(String targetRule) {
		this.targetRule = targetRule;
	}

	public String[] getHelpRule() {
		return helpRule;
	}

	public void setHelpRule(String[] helpRule) {
		this.helpRule = helpRule;
	}

	public Prop getProp() {
		return prop;
	}

	public void setProp(Prop prop) {
		this.prop = prop;
	}

	public static String getUa() {
		return ua;
	}
	
	public String getLocalPath() {
		return localPath;
	}

	public void setLocalPath(String localPath) {
		this.localPath = localPath;
	}

	/**
	 * Load property file. Example:<br>
	 * loadPropertyFile("db_username_pass.txt", "UTF-8");
	 * 
	 * @param fileName
	 *            the file in CLASSPATH or the sub directory of the CLASSPATH
	 * @param encoding
	 *            the encoding
	 */
	public Properties loadPropertyFile(String fileName, String encoding) {
		prop = PropKit.use(fileName, encoding);
		return prop.getProperties();
	}

}
